List of Topics
May 22, 2021 (03:03:05 AM)
General Concepts
Students should understand the meaning and importance of the following notions. This statement should be read as “understand the first sentence or paragraph on a wikipedia article”, taking high-level programming language as an example.
- Programming languages types and paradigms
- Machine language instructions
- Assembly instructions
- High-Level Programming Languages
- Object-oriented paradigm and data hiding
- The difference between roles (user, tester, programmer)
- How complex piece of software reuse previous pieces.
- The importance of security 🔒
- Types of attack (malware, phishing, social engineering, zero-day)
- Types of loss (loss of integrity / availability / confidentiality)
Writing and Compiling Programs
- Understand what the “flow of development” is:
- Having a goal
- Writing down specifications
- Creating the source code
- Running the compiler
- Reading the compiler’s output, warning and error messages
- Looking for documentation and help on-line and off-line
- Testing
- Making sure the program is secure 🔒
- Editing
- Reusing
- Using an IDE to
- Create a project,
- Perform some of the steps of the “flow of development”,
- Correctly save and re-open projects,
- Understand basic features of break points and debugging. ❓
The IDE used can be MonoDevelop or Visual Studio, the student can pick other IDEs if they wish but they will not be supported.
Computer Usage
- How to download and install an IDE in a secure way 🔒
- How to share and zip a project
- How to use shortcuts ❓
- How to look for on-line documentation
The Structure of a Program
First Program - Hello World
The students should understand all the components of a simple “Hello World” program:
- Comments (in line and block)
usingstatements and namespace / API concepts- blank lines and spacing
- indentation
- intro to classes and methods’ structures (body / header)
- status of
mainmethod - intro to Console’s
WriteandWriteLine - string literal
Rules and Conventions
- The difference between a “rule” (e.g. case-sensitivity) and a “convention” (commenting your code).
- Reserved words
- Identifiers and naming conventions
- That the distinction can vary with the programming language
- Importance and role of
{and}
Datatypes and Operators
Variable
- Datatype (numerical, boolean, string, character) – including a mention of reference datatypes
- Declaration, assignment, initialization
- Naming variables correctly
- The absence of default value after declaration (un-assigned variables)
Numerical Values
- Integers (
int,long) – range and size, signature (uint) - Floating Point (
float,double, anddecimal) – range, size and precision, - Type casting (e.g. from
inttodouble, and legal operations between different datatypes) and casting operator (e.g.(int)). - Overflow and underflow 🔒
Booleans
- Possible values (
true,false) - Usage
- That boolean variables are called “switches”
Operators
- Binary arithmetic operators:
*,/,%,+,- - Unary arithmetic operators:
++,-- - The difference between postfix and infix notation for unary operators ❓
- Comparison operators:
!=,==,>,>=,<,<= - Boolean logical operators:
&&,||,! - Precedence and “vadidity” of some expressions (typically,
! 2 < 3is not a valid expression) - Combined assignment operators:
+=,*=,-=,/=,%=
Strings
ReadLinemethod- Concatenation (
+) - Interpolation
- Additional methods:
ToLower,ToUpper,Contains❓
Displaying Strings on the Screen
- Format specifiers for numbers: – Currency (
C),- Fixed-point (
F) or Number (N) - Percent (
P) ❓ - Exponential (
E) ❓
- Fixed-point (
- The
String.Formatmethod
Characters
- Possible values and the existence of binary, oct, dec and hex representation (cf. for instance wikipedia)
- Escape character and sequences:
\n,\t,\\ - Conversion between glyph and decimal value.
- Various methods:
ToLower,ToUpper,Contains,StartsWith,EndsWith❓
Lists ❓
- Creating a list of numbers or strings
- Adding items using the
Addmethod - Accessing items using
[] - Removing and Inserting (
Remove,RemoveAt,Insert) Countproperty
Basic Control Structures
Selection Statements
For each of the following structure:
ifif-elseif-else if- nested
ifs switch
The student should understand
- Their importance,
- Their usage,
- Their syntax,
- Their flow,
- When to use one or the other,
- The common pitfals (e.g., writing a condition in a
switch).
Repetition Statements
For each of the following structure:
foreachwhilefordo{…}while(…)❓
The student should understand:
- Their importance,
- Their usage,
- Their syntax,
- Their flow,
- When to use one or the other,
- The common pitfals (e.g.
=instead of==,<= nvs< n)
As well as being capable of identifying the difference between
- Counter-controlled,
- Sentinel-controlled,
- User-controlled
and defining the term “accumulator”
Object-oriented programming
Class Conception
- Need and interest of specification 🔒
- UML Class diagram: interest, usage, and simple case (single class with attributes, methods and constructor).
- Access modifier (private, public)
- Principle of least privilege (private variables and methods where possible) 🔒
Class Implementation
- Attributes (and their default value, as well as how to change them)
- Get and Set methods
- Properties ❓
- Method signature
- Overloading
- Variable shadowing ❓
- Constructors: default constructor and “custom” constructor
Class Usage
- The
newkeyword - Object creation using default and custom constructors
- Object manipulation: calling a method, setting an attribute, calling the
ToStringmethod implicitely.
Additional Considerations
toStringmethod- static class and methods
MathClass (Abs,Sqrt,Pow) ❓
Random Class
- Creating a generator with
new Random() - Generating non-negative integers,
- Generating integers between ranges,
- Generating double,
- Generating a random word ❓
- Potential problems with deterministic generators 🔒
Testing and Debugging
- How to test intelligently
- How to test every instruction
- How to test boundary conditions
Interacting with Users
- Input validation 🔒
TryParsein theintanddecimalclasses.- Reading a single character from the user ❓
Data structures
Constant
- The
constkeyword - Example usages (Avogadro constant, miles-to-kilometer ratio, speed of light) and use case.
Math.PI❓- Static constant ❓
Enumerated Datatype
- Define enumerated datatypes using
enum - Enum values (i.e. numerical values assigned to enumerated values by default) ❓
- Use enumerated datatypes (variable declaration, assignment, displaying).
Arrays
Only one-dimensional arrays should be discussed.
- Vocabulary: index (starting at 0), bounds.
LengthpropertyResizemethod ❓- Different syntaxes for initializing and declaring arrays ❓
- Buffer overflow 🔒
Exceptions 🔜
try…catchblocks- Types of exceptions
finally- Defining your own exception
File I/O 🔜
StreamWriterandStreamReaderclasses- Manipulating binary and text files
Fileclass ❓